#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : booknptj_modules.py
# @Author: Xuhao
# @Date  : 2018/4/13
# @Desc  :

from app.Sql.SQLSession import Base,DataBaseConnector
from app.Modules.book_modules import NoverInfo

from sqlalchemy import Column, String, Integer
import json
from sqlalchemy.ext.declarative import DeclarativeMeta
from sqlalchemy.sql.expression import func

class BookNPTJ(Base):

    @classmethod
    def select_huoretj(cls, fl=0):

        connect = DataBaseConnector()

        session = connect.get_session()

        # bookinfo = session.query(NoverInfo).join(BookJinDian, NoverInfo.noveID == BookJinDian.bookID).filter(
        #     NoverInfo.noveCategory.in_(['玄幻魔法', '武侠修真'])).order_by(func.random()).limit(8).all()
        #
        # return json.dumps(bookinfo, cls=new_alchemy_encoder(False, 'NoverInfo'))